home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / Handle.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-16  |  1.2 KB  |  45 lines

  1. /* Copyright (C) 1986-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  2. #if __SC__ || __RCC__
  3. #pragma once
  4. #endif
  5.  
  6. #ifndef __HANDLE_H
  7. #define __HANDLE_H 1
  8.  
  9. #if __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. #define HANDLE_BASE    0xFE000000
  14. #define HANDLE_MAX    ((int)(0x10000 - (HANDLE_BASE >> 16)))
  15. #define HANDLE_PAGESIZE        (16*1024)
  16. int handle_ishandle(void __handle *h);
  17. #define handle_ishandle(h) ((int)(((unsigned long) (h) >= HANDLE_BASE) != 0))
  18. void __handle * __cdecl handle_malloc(unsigned);
  19. void __handle * __cdecl handle_calloc(unsigned);
  20. void __handle * __cdecl handle_realloc(void __handle *,unsigned);
  21. char __handle * __cdecl handle_strdup(char __handle *);
  22. void __cdecl handle_free(void __handle *);
  23. int __cdecl handle_usingemm(void);
  24. void __cdecl handle_remap(void);
  25. #if NO_HANDLE || DOS16RM || __INTSIZE == 4 || __OS2__ || __NT__
  26. #define __handle
  27. #define handle_malloc(n)    malloc(n)
  28. #define handle_calloc(n)    calloc((n),1)
  29. #define handle_realloc(h,n)    realloc((h),(n))
  30. #define handle_free(h)        free(h)
  31. #define handle_strdup(h)    strdup(h)
  32. #define handle_usingemm()    0
  33. #define handle_remap()
  34. #undef handle_ishandle
  35. #define handle_ishandle(h)    0
  36. #include    <stdlib.h>
  37. #include    <string.h>
  38. #endif
  39.  
  40. #if __cplusplus
  41. }
  42. #endif
  43.  
  44. #endif
  45.